<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="../templates/user_template.xhtml">

	<ui:define name="css-styles">
		<h:outputStylesheet library="css" name="staff.css" />
	</ui:define>

	<ui:define name="title">
		Програма за деня
	</ui:define>

	<ui:define name="content">

			<h1 align="center" id="program-header" style="color: black;">Добавяне
				на филм и прожекция</h1>
		<div id="wrapper">
			<div id="left">
				<h:panelGroup>
					<h2 style="color: black;">Информация за филм:</h2>
					<h:form id="movieForm">
						<table>
							<tr>
								<td>
									<h:outputText value="Име" />
								</td>
								<td>
									<h:inputText id="movieName" value="#{staffBean.moviePojo.name}"
										requiredMessage="*Field is required"
										validatorMessage="*Length is less than allowable minimum of '5'"
										required="true">
										<f:validateLength minimum="5" maximum="25" />
									</h:inputText>
								</td>
								<td>
									<h:message for="movieName" styleClass="warning" />
								</td>
							</tr>
							<tr>
								<td>
									<h:outputText value="Тип" />
								</td>
								<td>
									<h:inputText id="movieType"
										value="#{staffBean.moviePojo.movieType}"
										requiredMessage="*Field is required"
										validatorMessage="*Length is less than allowable minimum of '5'"
										required="true">
										<f:validateLength minimum="5" maximum="25" />
									</h:inputText>
								</td>
								<td>
									<h:message for="movieType" styleClass="warning" />
								</td>
							</tr>
							<tr>
								<td>
									<h:outputText value="Продължителност" />
								</td>
								<td>
									<h:inputText id="movieDuration"
										value="#{staffBean.moviePojo.duration}"
										requiredMessage="*Field is required"
										validatorMessage="*Length is less than allowable minimum of '5'"
										required="true">
		
									</h:inputText>
								</td>
								<td>
									<h:message for="movieDuration" styleClass="warning" />
								</td>
							</tr>
							<tr>
								<td></td>
								<td style="font-size: 11px">(HH:mm:ss)</td>
								<td></td>
							</tr>
							<tr>
								<td>
									<h:outputText value="Режисьор" />
								</td>
								<td>
									<h:inputText id="movieDirector"
										value="#{staffBean.moviePojo.director}"
										requiredMessage="*Field is required"
										validatorMessage="*Length is less than allowable minimum of '5'"
										required="true">
										<f:validateLength minimum="5" maximum="25" />
									</h:inputText>
								</td>
								<td>
									<h:message for="movieDirector" styleClass="warning" />
								</td>
							</tr>
							<tr>
								<td>
									<h:outputText value="Актьори" />
								</td>
								<td>
									<h:inputText id="movieActors"
										value="#{staffBean.moviePojo.actors}"
										requiredMessage="*Field is required"
										validatorMessage="*Length is less than allowable minimum of '5'"
										required="true">
										<f:validateLength minimum="5" maximum="25" />
									</h:inputText>
								</td>
								<td>
									<h:message for="movieActors" styleClass="warning" />
								</td>
							</tr>
							<tr>
								<td>
									<h:outputText value="Дърважа" />
								</td>
								<td>
									<h:inputText id="movieCountry"
										value="#{staffBean.moviePojo.country}"
										requiredMessage="*Field is required"
										validatorMessage="*Length is less than allowable minimum of '5'"
										required="true">
										<f:validateLength minimum="5" maximum="25" />
									</h:inputText>
								</td>
								<td>
									<h:message for="movieCountry" styleClass="warning" />
								</td>
							</tr>
							<tr>
								<td>
									<h:outputText value="Резюме" />
								</td>
								<td>
									<h:inputText id="movieSummary"
										value="#{staffBean.moviePojo.summary}"
										requiredMessage="*Field is required"
										validatorMessage="*Length is less than allowable minimum of '5'"
										required="true" escape="false">
										<f:validateLength minimum="5" maximum="500" />
									</h:inputText>
								</td>
								<td>
									<h:message for="movieSummary" styleClass="warning" />
								</td>
							</tr>
						</table>
						<h:commandButton value="Добави нов филм"
							actionListener="#{staffBean.addMovie}" type="submit"
							style="margin-top: 10px; margin-bottom: 10px;">
						</h:commandButton>
						<span><h:outputText value="#{staffBean.warninMssageMovie}" styleClass="warning" /></span>
						<span><h:outputText value="#{staffBean.succesMessageMovie}" styleClass="success" /></span>
						
					</h:form>
				</h:panelGroup>
			</div>
			<div id="rigth">
				<h:panelGroup>
					<h2 style="color: black;">Информация за прожекция:</h2>
					<h:form id="projectionForm">
						<table>
							<tr>
								<td>
									<h:outputText value="Дата, час" />
								</td>
								<td>
									<h:inputText id="projectionTimeStart"
										value="#{staffBean.projection.timeStart}"
										requiredMessage="*Field is required"
										validatorMessage="*Length is less than allowable minimum of '5'"
										required="true">
										<f:validateLength minimum="5" maximum="25" />
									</h:inputText>
								</td>
								<td>
									<h:message for="projectionTimeStart" styleClass="warning" />
								</td>
							</tr>
							<tr>
								<td></td>
								<td style="font-size: 11px">(yyyy-MM-dd HH:mm:ss)</td>
								<td></td>
							</tr>
							<tr>
								<td>
									<h:outputText value="Номер зала" />
								</td>
								<td>
									<!-- >h:inputText id="projectionHall"
										value="#{staffBean.projection.hallNumer}"
										requiredMessage="*Field is required"
										validatorMessage="*Length is less than allowable minimum of '1'"
										required="true">
										<f:validateLength minimum="1" maximum="3" />
									</h:inputText-->
									<h:selectOneMenu id="projectionHall" value="#{staffBean.projection.hallNumer}" required="true" 
									requiredMessage="*Field is required">
										<f:selectItem itemLabel="" />
										<f:selectItems value="#{staffBean.listHallNumbers}" />
									</h:selectOneMenu>
								</td>
								<td>
									<h:message for="projectionHall" styleClass="warning" />
								</td>
							</tr>
							<tr>
								<td>
									<h:outputText value="Име на филма" />
								</td>
								<td>
									<!--  >h:inputText id="movieNamee"
										value="#{staffBean.projection.movieName}"
										requiredMessage="*Field is required"
										validatorMessage="*Length is less than allowable minimum of '5'"
										required="true">
		
									</h:inputText-->
									
									<h:selectOneMenu id="movieNamee" value="#{staffBean.projection.movieName}" required="true" 
									requiredMessage="*Field is required">
										<f:selectItem itemLabel="" />
										<f:selectItems value="#{staffBean.listMovieNames}" />
									</h:selectOneMenu>
									
								</td>
								<td>
									<h:message for="movieNamee" styleClass="warning" />
								</td>
							</tr>
						</table>
						<h:commandButton value="Добави нова прожекция" 
							actionListener="#{staffBean.addProjection}" type="submit" 
							style="margin-top: 10px; margin-bottom: 10px;">
						</h:commandButton>
						<span><h:outputText value="#{staffBean.warninMssageProjection}" styleClass="warning" /></span>
						<span><h:outputText value="#{staffBean.succesMessageProjection}" styleClass="success" /></span>
					</h:form>
				</h:panelGroup>
			</div>
		</div>
		
	</ui:define>
</ui:composition>